//
//  myAvplayerViewController.m
//  XWZ_News_Work
//
//  Created by dllo on 16/1/15.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "myAvplayerViewController.h"

@interface myAvplayerViewController ()

@end

@implementation myAvplayerViewController

+ (instancetype)sharePlayer
{
    static myAvplayerViewController *playerVC = nil;
    static dispatch_once_t once;
    dispatch_once(&once, ^{
        playerVC = [[myAvplayerViewController alloc] init];
    });
    return playerVC;
}

- (void)setFrame:(CGRect)frame
{
    self.view.frame = frame;
}

- (void)playWithURL:(NSString *)url
{
    AVPlayerItem *playerItem = [[AVPlayerItem alloc] initWithURL:[NSURL URLWithString:url]];
    [self.myPlayer replaceCurrentItemWithPlayerItem:playerItem];
    [self.myPlayer play];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
